//分组打包 webpackChunkName名字一样就打包在一个文件
const selectComp=()=>import(/* webpackChunkName: "selectComponent" */ '@/components/selectComponent');
const Home=() => import(/* webpackChunkName: "Home" */ '@/views/Home');
const livegame=()=>import(/* webpackChunkName: "LiveGame" */ '@/views/LiveGame');
const game=()=>import(/* webpackChunkName: "game" */ '@/views/livegame/game');
const UserManager=()=>import(/* webpackChunkName: "UserManager" */ '@/views/UserManager');
const not_404=() => import(/* webpackChunkName: "404" */ '@/views/404');

const routes = [
  {
    path: '/',
    name: 'Home',
    component:Home,
    redirect:'livegame',
    children:[
      {
        path:'/livegame',
        name:'livegame',
        component:livegame,
        redirect:'game',
        children:[
          {
            path:'/game',
            name:'game',
            component:game,
          }
        ]
      },
      {
        path:'/UserManager',
        name:'UserManager',
        component:UserManager
      }
    ]
  },
  {
    path: '/Home',
    redirect:{path:'/'}
  },
  {
    path:'/404',
    component:not_404,
    name:'404',
    hidden: true
  },
  {
    path:'*',
    hidden:true,
    redirect:{path:'/404'}
  }
];

export default {
  routes:routes,
  selectComp:selectComp
}
